﻿<%@ page language="java" import="java.util.*" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@include file="/common/taglibs.jsp" %>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <title>反馈管理</title>

    <!--common-->
    <link href="/resources/src/css/main.css" rel="stylesheet">
    <link href="/resources/src/css/responsive.css" rel="stylesheet">
    <link href="/resources/src/css/feedback.css" rel="stylesheet">
</head>
<body class="sticky-header left-side-collapsed" style="background-color: #eff0f4;">
    
    <jsp:include page="common/left-slide.jsp" />
    <div class="main-content">
        <jsp:include page="common/header-start.jsp" />
        <div class="feedback">
            <div class="title">提交反馈</div>
            <div class="fb-form">
                <p>
                    <label for="questionTxt">问题描述：</label>
                    <textarea name="questionTxt" id="questionTxt" placeholder="请告诉我们您遇到的问题" rows="15"></textarea>
                </p>
                <p>
                    <label for="questionTxt">相关截图：</label>
                    <a href="javascript:;" class="fileBox" id="picUrl" style="position:relative; width:150px; height:150px; overflow:hidden; ">
                    	<!--icon-xiangji1-->
                    	<i class="iconfont icon-xiangji1"></i><input type="file">
                    	<span id='showProImg'></span>
                    </a>  
                    <!--<div id='showProImg' class="showProImg clearfix"></div> -->                 
                </p>
                <a href="javascript:void(0);" class="sendBtn">提交反馈</a>
            </div>
        </div>
    </div>
    

    
    
    <script src="/resources/src/js/jquery-1.9.1.min.js"></script>
    <script src="/resources/src/js/jquery.nicescroll.js"></script>
    <script src="/resources/src/js/main.js"></script> 
    <jsp:include page="/common/plupload/pluploadInclude.jsp"></jsp:include>
    <script>        
    //console.log($('.feedback').innerHeight())  
    $(function(){
    	proPicUpload();
    	$(".sendBtn").click(function(){
    		var questionTxt = $("#questionTxt").val();
    		var picUrl='';
    		$("img[name='proPic']").each(function(){
    			picUrl = $(this).attr("src") + "," + picUrl;
    		});
    		if(questionTxt == '' || questionTxt == null){
    			alert("请填写问题描述");
    			return false;
    		}
    		if(picUrl == '' || picUrl == null) {
    			alert("请添加相关截图");
    			return false;
    		}
    		$.ajax({
    			url : "/feedback/saveFeedback",
    			type : "post",
    			dataType: "json",
    			data : {
    				"picValue" : picUrl,
    				"content":questionTxt

    			},
    			success: function(data) {
    				alert(data.data);
    				location.reload();
    			}
    		});
    	})
    })
    
    //项目图片
	function proPicUpload(){
		var clickId = "picUrl";
		var fileName ="imageFile";
		var maxFileSize='50mb';//文件最大尺寸
		var FileType='jpg,gif,png,jpeg';//文件类型
		var progressBar='#proImgBar';//文件上传进度条
		var url = '/uploadFile/img';
		var successType='multi_img'; //multi_img
		var showImgDiv='#showProImg'; 
		uploadFile(fileName,url,clickId,maxFileSize,FileType,progressBar,successType,showImgDiv);
	}
    </script> 
</body>
</html>